
import type { RouteRecordRaw } from 'vue-router';
import config from '@/config';
// import Dashboard from '@/components/layout/dashboard.vue';

import { commonRoutes } from './modules/crm-common';
import demoRoutes from './modules/crm-demo';
import kgjRoutes from './modules/crm-kgj';
import cyRoutes from './modules/crm-cy';
import dyjRoutes from './modules/crm-dyj';
import agencyRoutes from './modules/crm-agency';
import contentRoutes from './modules/crm-content';

console.log(kgjRoutes, cyRoutes);

// 系统模块路由
export const dynamicRoutes = [
  kgjRoutes[0],
  cyRoutes[0],
  dyjRoutes[0],
  agencyRoutes[0],
  contentRoutes[0]
];

const routes: unknown[] | RouteRecordRaw[] = [
  {
    path: '/',
    // component: Dashboard,
    name: 'AppIndex',
    redirect: { name: 'KgjIndex' }
    // children: [...dynamicRoutes]
  }
];

// 开发环境有demo路由
if (config.isDev) {
  routes.push(...demoRoutes);
}

routes.push(...commonRoutes);

export default routes;
